package com.chance.cc.crawler.development.command.publish.dxy;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.dxy.normal.DXYForumCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.dxy.normal.DXYNewsCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.dxy.simple.DXYForumSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.dxy.simple.DXYNewsSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.dxy.trace.DXYForumTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.dxy.trace.DXYNewsTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.script.dxy.DXYScriptUpdate;
import com.chance.cc.crawler.development.command.trigger.domain.dxy.DXYSchedulerTriggerInfo;
import org.junit.Test;

/**
 * @author lt
 * @version 1.0
 * @date 2021-02-05 18:18:34
 * @email okprog@sina.com
 */
public class DXYPublishCrawlerJob {
    /**
     * 丁香园测试发布
     */
    @Test
    public void publishTestCrawlerJob(){
        CrawlerJob crawlerJob = DXYNewsSimpleCrawlerSchedulerJob.publishDXYCrawlerScheduleJobInfo();
        DXYSchedulerTriggerInfo.publishDXYTestCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
//        DXYScriptUpdate.publishCrawlerNodeScript();
    }

    /**
     * 丁香园资讯实时发布任务
     */
    @Test
    public void publishDxyNewsRealtimeJob(){
        CrawlerJob crawlerJob = DXYNewsCrawlerSchedulerJob.publishDXYCrawlerScheduleJobInfo();
        DXYSchedulerTriggerInfo.publishDXYNewsCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    /**
     * 丁香园资讯回溯发布任务
     */
    @Test
    public void publishDxyNewsTraceJob(){
        CrawlerJob crawlerJob = DXYNewsTraceCrawlerSchedulerJob.publishDXYCrawlerScheduleJobInfo();
        DXYSchedulerTriggerInfo.publishDXYNewsTraceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    /**
     * 丁香园论坛实时发布任务
     */
    @Test
    public void publishDxyForumJob(){
        CrawlerJob crawlerJob = DXYForumCrawlerSchedulerJob.publishDXYCrawlerScheduleJobInfo();
        DXYSchedulerTriggerInfo.publishDXYForumCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    /**
     * 丁香园论坛回溯发布任务
     */
    @Test
    public void publishDxyForumTraceJob(){
        CrawlerJob crawlerJob = DXYForumTraceCrawlerSchedulerJob.publishDXYCrawlerScheduleJobInfo();
        DXYSchedulerTriggerInfo.publishDXYForumTraceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

}
